Protection against Physical Attacks

From Kicksecure
Jump to navigation Jump to search

BIOS Password, Problematic Interfaces, Screen Lock, Virtual Consoles, Login Screen, Side Channel Attacks

Introduction[edit]

Physical attacks require adversaries to have direct access to a user's computer and cannot be conducted remotely. This section should be read in conjunction with the Full Disk Encryption and Encrypted Images chapters.

BIOS Password[edit]

The Basic Input/Output System (BIOS) is non-volatile firmware which performs hardware initialization during the computer's booting process after it is powered on. It also provides runtime services for operating systems and progams. BIOS in modern PCs initialize and test system hardware components, as well as loading a boot loader or operating system from a mass memory device. The Unified Extensible Firmware Interface (UEFI) is the successor to BIOS that was released in 2011. [1]

Most hardware-level settings are stored in BIOS, including power options, boot options and memory information. The BIOS menu allows the user to set and change a boot password for the computer upon startup. An administrator password can also be set to prevent others from changing BIOS settings.

  • A) BIOS power-on password; and/or
  • B) BIOS administrator password

To set a BIOS boot password: [2] [3]

  • Turn on / restart the computer.
  • Press the relevant key to access the BIOS menu. It is usually one of: Del, Esc, F2, F10, or F12.
  • Navigate to the Security or Password section using the arrow keys.
  • Search for an entry named "Password on boot" or similar.
  • Enter the new, strong password.
  • Save the changes made to BIOS settings. On most PCs, this is done by pressing Esc or F10Save and Exit. Check the bottom of the BIOS screen to be sure.
  • Reboot the computer and confirm a password prompt now appears.

For greater security, a password should be set to access the BIOS menu itself. Search the Security or Password BIOS menu for "Set supervisor password", "User password", "System password", or something similar. [4] Also, users may prefer to configure BIOS to only allow booting from HDD/SSD so the computer cannot be booted from CD-ROM or USB flash drives.

It should be noted that this is hardware dependent. There are:

  • A) Secure BIOS Password implementations: If the password has been forgotten, the motherboard might be brickedarchive.org.
  • B) Insecure BIOS Password implementations: On some hardware this method will only prevent casual attempts to gain access. There are numerousarchive.org methodsarchive.org of bypassing, removing or resetting BIOS passwordsarchive.org. Some methods include easily available recovery modes, removal of the CMOS batters and/or BIOS password reset jumperarchive.org.

Before relying on the security of the BIOS password, the user should research the security of their motherboard's BIOS.

Kicksecure is an Implementation of the Securing Debian Manual. This chapter has been inspired by: Securing Debian Manualarchive.org, chapter Choose a BIOS passwordarchive.org

Bootloader Password[edit]

Note: There are two distinct prompts in GRUB:

A) GRUB Bootloader Authentication Password Prompt (related to protecting GRUB menu and settings from unauthorized changes);

  • Figure: GRUB Bootloader Authentication Password Prompt

B) Legacy BIOS / EFI BIOS Disk Decryption Password Prompt (related to unlocking an encrypted /boot):

  • Figure: GRUB Bootloader Disk Decryption Password Prompt (EFI)

This chapter focuses on the bootloader authentication password.

Note: The GRUB authentication password is unrelated to Full Disk Encryption.

  • Purpose of a bootloader password:
    • Prevent unauthorized users from editing boot parameters or accessing recovery options through the GRUB menu.
    • Without a password, someone with physical access can modify boot entries to bypass security mechanisms, load an alternative kernel, or boot into single-user mode.
  • Is a GRUB password useful when using FDE with encrypted /boot?
  • When a GRUB password is useful with FDE and unencrypted /boot:
    • Protect Against Physical Access Attacks: If an attacker gains physical access and can boot from external media or tamper with the GRUB menu, they might not access the encrypted data but could still cause disruptions by modifying boot files.
  • When a bootloader password might be redundant:
    • Dedicated Single-User FDE Systems: If you're the sole user and you physically secure your device, a GRUB password might add minimal value.
    • Trusted Environment: If the system is in a trusted physical environment, the additional step of a GRUB password could be unnecessary.

A GRUB bootloader password is not critically important if you're already using full disk encryption, but it can provide an additional layer of security in specific scenarios when physical access is a concern. Assess your threat model and decide accordingly.

While a GRUB password can mitigate some physical attacks, it won't protect against many others.

  • Boot from Other Devices: Attackers can boot from a USB drive, CD, or network (PXE boot) to bypass the system’s internal bootloader entirely. A BIOS password might make attacks that rely on this strategy more difficult or impossible.
  • Disk Removal: Removing the disk and connecting it to another computer allows the attacker to bypass GRUB altogether. If the disk isn’t encrypted, the attacker has unrestricted access to all data.
  • Tampering with Hardware or Firmware: Attackers can flash the firmware (e.g., BIOS/UEFI) to introduce malicious code, effectively bypassing GRUB entirely or compromising the system during boot.
  • Others: Listed on this wiki page.

How to set a bootloader password[edit]

Simple

This is the simplest way to set a GRUB password, assuming the user is named user and has root access. Using this method, all GRUB/boot menu entries will be locked behind a username and password.

1. Make sure grub-common is installed.

sudo apt update && sudo apt install grub-common

2. Run the Grub password generator grub-mkpasswd-pbkdf2archive.org and enter the desired password that you wish to use.

grub-mkpasswd-pbkdf2

3. The output will look similar to the following: (copy the part starting with grub.pbkdf2.sha512.10000.<hashed-password>)

PBKDF2 hash of your password is grub.pbkdf2.sha512.10000.<The-hashed-password>

4. Open the custom GRUB configuration file at /etc/grub.d/40_custom (using a text editor like nano).

sudo nano /etc/grub.d/40_custom

5. Add the necessary lines to the file, including the copied grub.pbkdf2.sha512.10000.<hashed-password> along with the username of the machine (which is user in our case).

set superusers="user" password_pbkdf2 user grub.pbkdf2.sha512.10000.<hashed-password>

6. Save and exit the file, then update GRUB to apply the changes.

sudo update-grub

7. Reboot. A prompt should appear if you press the e key, Esc, or if you want to run Kicksecure from the boot menu, asking for a username and password.

8. Done.

Advanced

Separate root and user

Hide the Ability to Edit Entries

This is undocumented.

Disable GRUB to show advanced entries (like recovery mode)

This is undocumented.

See also: GRUB

Kicksecure is an Implementation of the Securing Debian Manual. This chapter has been inspired by: Securing Debian Manualarchive.org, chapter Set a (...) GRUB passwordarchive.org

Cold Boot Attacks[edit]

Check Cold Boot Attack Defense Section.

Evil Maid Attack[edit]

Check Anti Evil Maid Section.

Problematic Interfaces[edit]

There are a number of computer interfaces that pose the risk of a direct memory access (DMA) attackarchive.org. Potentially exploitable interfaces include ExpressCard, PCMCIA, FireWire, PCI, PCI Express or Thunderbolt.

High-speed expansion ports allow attackers to penetrate computers and other peripherals because the connected devices have direct hardware access to enable maximum throughput.

In practice, attached devices are permitted to read and write directly to memory, often without supervision of the operating system. This is in contrast to user-mode applications that are usually prevented from accessing memory locations that are not explicitly authorized by virtual memory controllers. [5]

A successful DMA attack on an unattended, live computer allows the adversary to: [6] [5] [7] [8]

  • Access sensitive cryptographic material in memory.
  • Circumvent FDE.
  • Inject executable code.
  • Partially or fully read the memory address space.
  • Read documents, files or other digital traces present in memory.
  • Take control of the entire system, for example via the network.
  • Unlock screensavers without a passphrase.

DMA attack software tools which mimic the abilities of state-level adversariesarchive.org are even available on GitHubarchive.org! [9] Mitigating the threat of a DMA attack requires mostly physical security countermeasures; it is recommended to:

  • Consider blocking or removing dangerous ports completely.
  • Disable them in BIOS or UEFI.
  • Never allow unknown and potentially malicious devices to be inserted into these ports. [10]
  • Securely configure these interfaces.
  • Use IOMMUarchive.org technology if available, along with software which supports it, like Qubes. [11]
  • Use Linux kernel options to disable DMA by Firewire devices. Package security-misc is installed by default and implements this, see also package descriptionarchive.org).

Screen Lock[edit]

Info If a computer is left unattended, always lock the screen of the host or shut it down for greater safety.

Locking the screen on the host prevents others from viewing or using the device. It is advisable to set the screen to lock after a certain period of inactivity, and a strong password is recommended. Note that screen lockers provide notoriously weak protectionarchive.org, so do not overestimate their effectiveness. [12]

To manually lock the screen: [13] [14]

Linux

  • Menu panelLock Screen.
  • Shortcuts are specific to the desktop environment in use, for example, GNOME, KDE, Xfce and so on.

Recommendations:

  • Do not enable Alt + Crtl + Backspace to kill the X Server. Do not disable DontZap in Xorg configuration. [15] [16]

Sleep Mode[edit]

Best avoided unless a screen lock is being used. See also above.

Virtual Consoles[edit]

Linux allows you to access a text-only user interface to the system by pressing a key combo like Ctrl+Alt+F1, Ctrl+Alt+F2, etc. These virtual consoles are not locked by the GUI screen locker, and do not automatically time out. If you use virtual consoles for any reason, you should always run exit to log out of the virtual console immediately after you are done using it. It's also advisable to check all virtual consoles and log out them before leaving the system unttended. [15] [17]

Login Screen[edit]

graphical login screen (by login manager LightDM)

Host versus VMs:

  • Host operating system: A login screen can be useful if the user wants to require a password in order to log in to the system.
  • VMs: It is not very useful to enable a login screen inside VMs. If the host operating system (OS) is ever compromised, then any VMs it hosts are also effectively compromised. Therefore, if anything, it is much better to lock the host screen. See also Screen Lock.

Note:

A login screen can be provided by a login manager. For example, LightDM is the login manager used by default in Kicksecure.

Kicksecure is configured by default to autologin. Hence, no login screen will be shown by default.

To enable a login screen in Kicksecure, it is required to disable autologin. For instructions on how to do that, see disable autologin.

See also: Login

Side Channel Attacks[edit]

Info Kicksecure does not provide protection against most side-channel attacksarchive.org.

Side-channel attacks are made possible by physical effects caused by cryptosystem operations (on the side) which provide extra information about system secrets like cryptographic keys, state information, or full/partial plaintexts. Wikipedia defines side-channel attacks as: [18]

...any attack based on information gained from the physical implementation of a cryptosystem, rather than brute force or theoretical weaknesses in the algorithms (compare cryptanalysis). For example, timing information, power consumption, electromagnetic leaks or even sound can provide an extra source of information, which can be exploited to break the system.

Side-channels emerge because computation takes place on a non-ideal system, composed of transistors, wires, power supplies, memory, and peripherals. Component characteristics vary with the instructions and data that are processed, allowing measurable variance to be used by attackers. [19]

Table: Primary Side-channel Attack Classes [18]

Attack Class Description
Acoustic Cryptanalysis Sound produced during computation is used for attacks.
Cache Attacks Attackers monitor cache accesses made by the user in shared physical systems like virtualized environments or cloud services.
Data Remanence Sensitive data are read after supposedly being deleted.
Differential Fault Analysis Secrets are discovered by introducing faults in a computation.
Electromagnetic Attacks Leaked electromagnetic radiation allows attacks that can provide plaintexts and other information. Cryptographic keys can be inferred via this method; for example, see TEMPESTarchive.org.
Optical Secrets and sensitive data are read by visual recordings with a high resolution camera, or other devices.
Power-monitoring Attacks Attacks use measurements of varying hardware power consumption during computation.
Software-initiated Fault Attacks Row hammerarchive.org is an example of this attack, whereby off-limits memory is changed by rapidly accessing adjacent memory, leading to state retention loss.
Timing Attacks Attacks are based on measuring how long various computations take to perform, such as the attacker's password compared to the user's unknown one.

While Kicksecure has some limited countermeasures to side-channel attacks, in general it cannot provide protection against most classes, nor hardware keyloggersarchive.org, TEMPEST, miniature cameras, laser microphones and so on. Full disk encryption is also helpless against these attacks.

For further reading on this complex topic, see herearchive.org, herearchive.org and herearchive.org.

Hardware-based Tampering Protection[edit]

Many attacks are possible if a sufficiently sophisticated attacker is able to probe, modify, or directly access hardware interfaces inside a device. Many devices used within modern systems assume that they are operating in a trusted environment and thus make no or very little effort to secure or validate the origin of signals they send and receive. This means that if an attacker is able to sniff these signals or inject their own signals into the system, they can potentially compromise the machine and gain access to sensitive data such as encryption keys. This videoarchive.org provides a good overview of an attack on a TPM chip that uses hardware tampering. The equipment necessary to carry out these attacks is not always expensive or difficult to use.

Hardware-based tampering protection mechanisms attempt to detect when an attacker is tampering with the system, taking immediate measures to report or prevent the attack. These kinds of protections are generally integrated into computer hardware as part of the device, though there are exceptions. If your computer supports tampering protection, it will likely allow you to configure this protection in the BIOS settings. The exact steps to take to enable tampering protection will depend on your hardware.

Some examples of tampering protection mechanisms:

  • Enterprise-grade Dell hardware (e.g., Optiplex and Latitude machines) often features a chassis intrusion switcharchive.org that detects when the side panel is removed from the machine.
    • Depending on the machine, this switch may be configured to:
      • Log intrusion events in the BIOS.
      • Beep very loudly when the machine is opened.
      • Prevent the system from booting until an intrusion warning is cleared by an authorized user.
    • A determined attacker may bypass the switch by cutting the cover open rather than removing it normally.
  • Some HP machines include a feature called TamperLockarchive.org, which is similar to a chassis intrusion switch. In addition to blocking boot, TamperLock can clear the system's TPM when the cover is opened.
  • The ORWL physically secure computerarchive.org used a special wire mesh to detect any attempt to physically access the motherboard (including drilling or cutting the outer cover). When detected, the system would immediately wipe an internal encryption key used to protect the internal solid-state drive. ORWL machines are no longer produced.
  • The PHYSEC SEALarchive.org is a miniature radar device that can detect and report when a device is tampered with.

Malicious Hardware Modifications[edit]

Hardware implants.

Hardware Replacement or Modification: Attackers could replace hardware components, such as the keyboard, to capture passwords or encryption keys, bypassing the need for GRUB, /boot partition tampering by sniffing full disk decryption passwords.

External:

Internal:

See Also[edit]

Footnotes[edit]

  1. https://en.wikipedia.org/wiki/BIOSarchive.org
  2. https://web.archive.org/web/20220803213740/https://www.techwalla.com/articles/how-to-change-the-administrator-password-in-biosarchive.org
  3. https://web.archive.org/web/20210430031204/https://www.intowindows.com/how-to-set-bios-or-uefi-password-in-windows-10/archive.org
  4. If the system has both a supervisor password and a user password, then set passwords for both.
  5. 5.0 5.1 https://en.wikipedia.org/wiki/DMA_attackarchive.org
  6. https://louwrentius.com/firewire-the-forgotten-security-risk.htmlarchive.org
  7. https://privatecore.com/resources-overview/physical-memory-attacks/index.htmlarchive.org
  8. https://web.archive.org/web/20170427144955/https://www.delaat.net/rp/2011-2012/p14/report.pdfarchive.org
  9. This is not an endorsement for the use of hacking tools.
  10. This is another reason why high-risk users should never leave their devices unattended.
  11. IOMMU maps device-visible virtual addresses to physical addresses. The security benefit is that devices that are passed through to guest virtualized machines -- AppVMs in Qubes -- are unable to access the host's physical memory. This makes DMA attacks against the host very difficult and can lead to memory corruption if attempted. Qubes OS automatically uses device passthrough to isolate USB controllers and network devices from the host, thus helping prevent these and other attacks. An IOMMU may also prevent DMA attacks from host devices (not passed through to a VM), although this is not necessarily guaranteed to work in all situations. See https://security.stackexchange.com/questions/176503/dma-attacks-despite-iommu-isolationarchive.org
  12. Attacks that have bypassed screen lockers on most platforms can easily be found online.
  13. https://www.isunshare.com/windows-10/3-ways-to-lock-windows-10-computer.htmlarchive.org
  14. https://swissmacuser.ch/new-lock-screen-feature-in-macos-high-sierra/archive.org
  15. 15.0 15.1 https://forums.whonix.org/t/screen-locker-in-security-can-we-disable-these-at-least-4-backdoors/8128archive.org
  16. Quote xscreensaver FAQarchive.org:

    Backdoor #1: Ctrl-Alt-Backspace

    This keystroke kills the X server, and on some systems, leaves you at a text console. If the user launched X11 manually, that text console will still be logged in. [...]

  17. Quote xscreensaver FAQarchive.org:

    Backdoor #2: Ctrl-Alt-F1 , Ctrl-Alt-F2 , etc.

    These keystrokes will switch to a different virtual console, while leaving the console that X11 is running on locked. If you left a shell logged in on another virtual console, it is unprotected. So don’t leave yourself logged in on other consoles. You can disable VT switching globally and permanently by setting DontVTSwitch in your xorg.conf, but that might make your system harder to use.

  18. 18.0 18.1 https://en.wikipedia.org/wiki/Side-channel_attackarchive.org
  19. http://rootlabs.com/articles/IEEE_SideChannelAttacks.pdfarchive.org

License[edit]

Kicksecure Protection Against Physical Attacks wiki page Copyright (C) Amnesia <amnesia at boum dot org>
Kicksecure Protection Against Physical Attacks wiki page Copyright (C) 2012 - 2024 ENCRYPTED SUPPORT LP <

This program comes with ABSOLUTELY NO WARRANTY; for details see the wiki source code.
This is free software, and you are welcome to redistribute it under certain conditions; see the wiki source code for details.

We believe security software like Kicksecure needs to remain Open Source and independent. Would you help sustain and grow the project? Learn more about our 12 year success story and maybe DONATE!